Optimal. Leaf size=137 \[ -\frac {4 (4 A+C) \sin (c+d x)}{3 a^2 d}+\frac {(7 A+2 C) \sin (c+d x) \cos (c+d x)}{2 a^2 d}-\frac {2 (4 A+C) \sin (c+d x) \cos (c+d x)}{3 a^2 d (\sec (c+d x)+1)}+\frac {x (7 A+2 C)}{2 a^2}-\frac {(A+C) \sin (c+d x) \cos (c+d x)}{3 d (a \sec (c+d x)+a)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.31, antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {4085, 4020, 3787, 2635, 8, 2637} \[ -\frac {4 (4 A+C) \sin (c+d x)}{3 a^2 d}+\frac {(7 A+2 C) \sin (c+d x) \cos (c+d x)}{2 a^2 d}-\frac {2 (4 A+C) \sin (c+d x) \cos (c+d x)}{3 a^2 d (\sec (c+d x)+1)}+\frac {x (7 A+2 C)}{2 a^2}-\frac {(A+C) \sin (c+d x) \cos (c+d x)}{3 d (a \sec (c+d x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2635
Rule 2637
Rule 3787
Rule 4020
Rule 4085
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{(a+a \sec (c+d x))^2} \, dx &=-\frac {(A+C) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {\int \frac {\cos ^2(c+d x) (-a (5 A+2 C)+3 a A \sec (c+d x))}{a+a \sec (c+d x)} \, dx}{3 a^2}\\ &=-\frac {2 (4 A+C) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A+C) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {\int \cos ^2(c+d x) \left (-3 a^2 (7 A+2 C)+4 a^2 (4 A+C) \sec (c+d x)\right ) \, dx}{3 a^4}\\ &=-\frac {2 (4 A+C) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A+C) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(4 (4 A+C)) \int \cos (c+d x) \, dx}{3 a^2}+\frac {(7 A+2 C) \int \cos ^2(c+d x) \, dx}{a^2}\\ &=-\frac {4 (4 A+C) \sin (c+d x)}{3 a^2 d}+\frac {(7 A+2 C) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {2 (4 A+C) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A+C) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {(7 A+2 C) \int 1 \, dx}{2 a^2}\\ &=\frac {(7 A+2 C) x}{2 a^2}-\frac {4 (4 A+C) \sin (c+d x)}{3 a^2 d}+\frac {(7 A+2 C) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {2 (4 A+C) \cos (c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A+C) \cos (c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.27, size = 281, normalized size = 2.05 \[ \frac {\sec \left (\frac {c}{2}\right ) \cos \left (\frac {1}{2} (c+d x)\right ) \sec ^2(c+d x) \left (36 d x (7 A+2 C) \cos \left (c+\frac {d x}{2}\right )+147 A \sin \left (c+\frac {d x}{2}\right )-239 A \sin \left (c+\frac {3 d x}{2}\right )-63 A \sin \left (2 c+\frac {3 d x}{2}\right )-15 A \sin \left (2 c+\frac {5 d x}{2}\right )-15 A \sin \left (3 c+\frac {5 d x}{2}\right )+3 A \sin \left (3 c+\frac {7 d x}{2}\right )+3 A \sin \left (4 c+\frac {7 d x}{2}\right )+84 A d x \cos \left (c+\frac {3 d x}{2}\right )+84 A d x \cos \left (2 c+\frac {3 d x}{2}\right )+36 d x (7 A+2 C) \cos \left (\frac {d x}{2}\right )-381 A \sin \left (\frac {d x}{2}\right )+96 C \sin \left (c+\frac {d x}{2}\right )-80 C \sin \left (c+\frac {3 d x}{2}\right )+24 C d x \cos \left (c+\frac {3 d x}{2}\right )+24 C d x \cos \left (2 c+\frac {3 d x}{2}\right )-144 C \sin \left (\frac {d x}{2}\right )\right )}{48 a^2 d (\sec (c+d x)+1)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.43, size = 134, normalized size = 0.98 \[ \frac {3 \, {\left (7 \, A + 2 \, C\right )} d x \cos \left (d x + c\right )^{2} + 6 \, {\left (7 \, A + 2 \, C\right )} d x \cos \left (d x + c\right ) + 3 \, {\left (7 \, A + 2 \, C\right )} d x + {\left (3 \, A \cos \left (d x + c\right )^{3} - 6 \, A \cos \left (d x + c\right )^{2} - {\left (43 \, A + 10 \, C\right )} \cos \left (d x + c\right ) - 32 \, A - 8 \, C\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 2.18, size = 137, normalized size = 1.00 \[ \frac {\frac {3 \, {\left (d x + c\right )} {\left (7 \, A + 2 \, C\right )}}{a^{2}} - \frac {6 \, {\left (5 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} a^{2}} + \frac {A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 21 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.17, size = 184, normalized size = 1.34 \[ \frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{6 d \,a^{2}}+\frac {C \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d \,a^{2}}-\frac {7 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d \,a^{2}}-\frac {3 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d \,a^{2}}-\frac {5 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{d \,a^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {3 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,a^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {7 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{d \,a^{2}}+\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{d \,a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.43, size = 236, normalized size = 1.72 \[ -\frac {A {\left (\frac {6 \, {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {5 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2} + \frac {2 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\frac {21 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {42 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )} + C {\left (\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.66, size = 134, normalized size = 0.98 \[ \frac {x\,\left (7\,A+2\,C\right )}{2\,a^2}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,\left (A+C\right )}{2\,a^2}+\frac {2\,A}{a^2}\right )}{d}-\frac {5\,A\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+3\,A\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^2\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (A+C\right )}{6\,a^2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {A \cos ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________